#include <bits/stdc++.h>
using namespace std;
int main() {
  int prop[2] = {0, 0};
  int x;
  cin >> x;
  if ((x & 1) == 0) prop[0] = 1;
  if (x > 4 && x <= 12) prop[1] = 1;
  printf("%d %d %d %d\n", prop[0] & prop[1], prop[0] | prop[1],
         prop[0] ^ prop[1], !prop[0] & !prop[1]);
}
